<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>四川大学威胁感知平台</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <!--引入本地layui.css-->
  <link rel="stylesheet" href="/layui/css/layui.css" media="all">
  <!--引入本地自定义的admin.css-->
  <link rel="stylesheet" href="/layui/layuiAdmin/css/admin.css" media="all">

  <script>
      /^http(s*):\/\//.test(location.href) || alert('请先部署到 localhost 下再访问');
  </script>

  <script type="text/javascript" src="/js/jquery-2.0.3.min.js"></script>
</head>
<body class="layui-layout-body">

<div id="LAY_app">
  <div class="layui-layout layui-layout-admin">
    <div class="layui-header" style="background-color: white!important;">
      <!-- 头部区域 -->
      <ul class="layui-nav layui-layout-left">
        <li class="layui-nav-item layadmin-flexible" lay-unselect>
          <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
            <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
          </a>
        </li>
        <li class="layui-nav-item layui-hide-xs" lay-unselect>
          <input type="text" placeholder="搜索..." autocomplete="off" class="layui-input layui-input-search" layadmin-event="serach" lay-action="template/search.html?keywords=">
        </li>
      </ul>
      <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">

        <li class="layui-nav-item" lay-unselect>
          <a lay-href="views/about/index.html" layadmin-event="message" lay-text="消息中心">
            <i class="layui-icon layui-icon-notice"></i>

            <!-- 如果有新消息，则显示小圆点 -->
            <span class="layui-badge-dot"></span>
          </a>
        </li>
        <li class="layui-nav-item" lay-unselect>
          <a href="javascript:;">
            <cite id="showAccount" style="color: #1C9399;font-weight: bold;padding-right: 5px;">admin</cite>
          </a>
          <dl class="layui-nav-child">
            <dd><a lay-href="personal_information_management/info.html">基本资料</a></dd>
            <dd><a lay-href="personal_information_management/password.html">修改密码</a></dd>
            <hr>
            <dd layadmin-event="logout" style="text-align: center;"><a href="javascript:void(0);" id="logout">退出</a></dd>
          </dl>
        </li>

        <li class="layui-nav-item layui-hide-xs" lay-unselect>
          <a href="javascript:;"><i class="layui-icon layui-icon-more-vertical"></i></a>
        </li>
      </ul>
    </div >

    <!-- 侧边菜单 -->
    <div class="layui-side layui-side-menu" style="background-color: #393D49!important;">
      <div class="layui-side-scroll">
        <div class="layui-logo" lay-href="home/console.html" style="background-color: #393D49!important;">
          <span>四川大学威胁感知平台</span>
        </div>

        <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
          <!--首页-->
          <li data-name="home" class="layui-nav-item layui-nav-itemed">
            <a href="javascript:;" lay-tips="主页" lay-direction="2" >
              <i class="layui-icon layui-icon-home"></i>
              <cite>主页</cite>
            </a>
            <dl class="layui-nav-child">
              <dd >
                <i class="layui-icon layui-icon-app"></i>
                <a lay-href="/page/console" >分析平台</a>
              </dd>
            </dl>
          </li>
          <!--基础数据-->
          <li data-name="procurement" class="layui-nav-item">
            <a href="javascript:;" lay-tips="基础数据" lay-direction="2">
              <i class="layui-icon layui-icon-form"></i>
              <cite>基础数据</cite>
            </a>
            <dl class="layui-nav-child">
              <dd>
                <!--lay-href：当点击时，跳转到对应URL地址去-->
                <i class="layui-icon layui-icon-user"></i>
                <a lay-href="/page/user/list">用户管理</a>
              </dd>
              <dd>
                <i class="layui-icon layui-icon-radio"></i>
                <a lay-href="/page/role/list">角色管理</a>
              </dd>
              <dd>
                <i class="layui-icon layui-icon-auz"></i>
                <a lay-href="/page/access/list">权限管理</a>
              </dd>
            </dl>
          </li>
          <!--资产管理-->
          <li data-name="sales" class="layui-nav-item">
            <a href="javascript:;" lay-tips="资产管理" lay-direction="2">
              <i class="layui-icon layui-icon-dollar"></i>
              <cite>资产管理</cite>
            </a>
            <dl class="layui-nav-child">
              <dd>
                <i class="layui-icon layui-icon-list"></i>
                <a lay-href="/page/host/list">主机列表</a>
              </dd>
              <dd>
                <i class="layui-icon layui-icon-table"></i>
                <a lay-href="hospital_info_mangement/doctor/list.html">资产类型</a>
              </dd>
            </dl>
          </li>
          <!--风险发现管理-->
          <li data-name="warehouse" class="layui-nav-item">
            <a href="javascript:;"  lay-tips="风险发现" lay-direction="2">
              <i class="layui-icon layui-icon-tabs"></i>
              <cite>风险发现</cite>
            </a>
            <dl class="layui-nav-child">
              <dd>
                <i class="layui-icon layui-icon-senior"></i>
                <a lay-href="/page/host/hotfixList">安全补丁</a>
              </dd>
              <dd>
                <i class="layui-icon layui-icon-video"></i>
                <a lay-href="/page/host/vulList">漏洞检测</a>
              </dd>
              <dd>
                <i class="layui-icon layui-icon-password"></i>
                <a lay-href="/page/host/weakPwdList">弱密码</a>
              </dd>
              <dd>
                <i class="layui-icon layui-icon-service"></i>
                <a lay-href="/page/host/appVulList">应用风险</a>
              </dd>
              <dd>
                <i class="layui-icon layui-icon-search"></i>
                <a lay-href="/page/host/systemVulList">系统风险</a>
              </dd>
            </dl>
          </li>
          <!--安全日志管理-->
          <li data-name="personnel" class="layui-nav-item">
            <a href="javascript:;"  lay-tips="安全日志管理" lay-direction="3">
              <i class="layui-icon layui-icon-chart"></i>
              <cite>安全日志管理</cite>
            </a>
            <dl class="layui-nav-child">
              <dd>
                <i class="layui-icon layui-icon-log"></i>
                <a lay-href="/page/log/list">审计日志</a>
              </dd>
              <dd>
                <i class="layui-icon layui-icon-loading"></i>
                <a lay-href="/page/log/loginList">登录日志</a>
              </dd>
              <dd>
                <i class="layui-icon layui-icon-camera"></i>
                <a lay-href="/page/log/accountList">账号变更日志</a>
              </dd>

            </dl>
          </li>
          <!--合规基线-->
          <li data-name="system" class="layui-nav-item">
            <a href="javascript:;" lay-tips="合规基线" lay-direction="2">
              <i class="layui-icon layui-icon-set"></i>
              <cite>合规基线</cite>
            </a>
            <dl class="layui-nav-child">
              <dd>
                <i class="layui-icon layui-icon-list"></i>
                <a lay-href="system_set/sys_user_mangement/list.html">基线规则管理</a>
              </dd>
              <dd>
                <i class="layui-icon layui-icon-mike"></i>
                <a lay-href="system_set/sys_role_mangement/list.html">基线任务管理</a>
              </dd>
              <dd>
                <i class="layui-icon layui-icon-release"></i>
                <a lay-href="system_set/sys_menu_mangement/list.html">基线检测结果</a>
              </dd>
            </dl>
          </li>
        </ul>
      </div>
    </div>

    <!-- 页面标签 -->
    <div class="layadmin-pagetabs" id="LAY_app_tabs">
      <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
      <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
      <div class="layui-icon layadmin-tabs-control layui-icon-down">
        <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
          <li class="layui-nav-item" lay-unselect>
            <a href="javascript:;"></a>
            <dl class="layui-nav-child layui-anim-fadein">
              <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd>
              <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd>
              <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd>
            </dl>
          </li>
        </ul>
      </div>
      <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
        <ul class="layui-tab-title" id="LAY_app_tabsheader">
          <li lay-id="home/console.html" lay-attr="home/console.html" class="layui-this"><i class="layui-icon layui-icon-home"></i></li>
        </ul>
      </div>
    </div>


    <!-- 主体内容 -->
    <div class="layui-body" id="LAY_app_body">
      <div class="layadmin-tabsbody-item layui-show">
        <iframe src="/page/console" frameborder="0" class="layadmin-iframe"></iframe>
      </div>
    </div>

    <!-- 辅助元素，一般用于移动设备下遮罩 -->
    <div class="layadmin-body-shade" layadmin-event="shade"></div>
  </div>
</div>

<!--引入本地的Layui.js-->
<script type="text/javascript" src="/layui/layui.js"></script>
<script type="text/javascript">
    layui.config({
        base: '/layui/layuiAdmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use('index');
    layui.use('layer',function (){
      var layer = layui.layer;
      $(function (){
        // 获取登录用户名
        var login_user = localStorage.getItem("username")
        if(login_user == null){
          //没有登录直接跳转到登录页面
          window.location.href = "/page/login";
          return;
        }
        // 显示登录用户名
        $("#showAccount").text(localStorage.getItem("username"));

        // 退出
        $("#logout").click(function (){
          layer.confirm('确定退出吗？', {
            btn: ['确定', '取消']
          }, function(index, layero){
            // 异步请求退出登录接口，清楚认证数据
            $.ajax({
              url:"/user/logout",
              type:"post",
              cache:false,
              contentType:"application/json;charset=utf-8",
              datatype:"json",
              beforeSend: function (xhr) {
                // 设置token
                xhr.setRequestHeader('Authorization', localStorage.getItem('token'));
              },
              success:function(response){
                console.log("退出成功: " + JSON.stringify(response));
                // 本地对象清空
                localStorage.clear();
                // 跳转到登录页面
                window.location.href = "/page/login";
              },
              error:function(response){
                console.log("退出失败: " +response);
              }
            })
          });


        })
      })
    })
</script>

</body>
</html>
